package com.zzzy.sys.vo.usermanage;

import com.zzzy.framework.common.annotation.RangeValuesCheck;
import com.zzzy.sys.common.enums.GenderEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import java.util.List;


@Schema(description = "新增用户")
@Data
public class UserAddReq {

    @Schema(description = "用户名", example = "cs01")
    @NotBlank(message = "用户名不能为空")
    @Length(max = 50, message = "用户名不能超过50个字符")
    private String username;

    @Schema(description = "真实姓名", example = "测试01")
    @NotBlank(message = "真实姓名不能为空")
    @Length(max = 30, message = "真实姓名不能超过30个字符")
    private String nickName;

    @Schema(description = "部门ID")
    private Long deptId;

    @Schema(description = "职务")
    @Length(max = 100, message = "职务不能超过100个字符")
    private String duty;

    @Schema(description = "性别", example = "男")
    @RangeValuesCheck(enumValueRange = GenderEnum.class, message = "性别填写错误")
    private String sex;

    @Schema(description = "手机号码", example = "13333333333")
    @Pattern(regexp = "^(((13[0-9]{1})|(15[0-9]{1})|(18[0-9]{1})|(17[0-9]{1})|(19[0-9]{1}))+\\d{8})$", message = "请输入正确手机号")
    @NotBlank(message = "手机号码不能为空")
    private String phoneNumber;

    @Schema(description = "邮箱", example = "2222222@qq.com")
    @Email(message = "请输入正确邮箱")
    private String email;

    @Schema(description = "角色ID")
    private List<Long> roleIds;

    @Schema(description = "备注")
    @Length(max = 255, message = "备注信息不能超过255个字符")
    private String memo;

}